export wasm_k3s="ghcr.nju.edu.cn/deislabs/containerd-wasm-shims/examples/k3d:v0.11.1" # wasm-runtime
export registry_config="registries.yaml"
export cluster_name="wasm"
export servers="1"
export agents="2"
export port="6550"

k3d cluster create $cluster_name --api-port $port --verbose \
  -p "443:443@loadbalancer" -p "80:80@loadbalancer" \
  --servers $servers --agents $agents \
  --k3s-arg "--disable=traefik@server:*" \
  --registry-config $registry_config \
  --image $wasm_k3s

# 更改数据平面label
# kubectl label node k3d-wasm-agent-0 node-role.kubernetes.io/worker=worker
# kubectl label node k3d-wasm-agent-1 node-role.kubernetes.io/worker=worker

# 输出kubeconfig
rm -rf /mnt/c/Users/Administrator/AppData/Roaming/Freelens/kubeconfigs/k3d-wasm
export KUBECONFIG=~$HOME/.kube/config
cat $HOME/.kube/config >/mnt/c/Users/Administrator/AppData/Roaming/Freelens/kubeconfigs/k3d-wasm
